package demo9;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @description: 通过注解实现属性的注入
 * @author: apple
 * @date:  2022/2/3 6:37 下午
 * @version 1.0
 **/
public class UserServiceTest {

    @Test
    public void test() {
        ApplicationContext context = new ClassPathXmlApplicationContext("bean10.xml");
        UserService userService = context.getBean("userService",UserService.class);
        System.out.println(userService);
        userService.add();

        userService.getDao2().add();
        final String id = userService.getId();
        System.out.println(id);
//        System.out.println(userService.getDao2());
    }

}
